package pl.mcnova;

import javax.swing.SwingUtilities;
import javax.swing.UIManager;

import pl.mcnova.view.dialogs.LoginDialog;

public class StartMcNova {

	public StartMcNova(LoginDialog dialog) {

		McNova.getInstance();
		McNova.init(dialog.getLogin(), dialog.getPass());
	}

	public static void main(String[] args) throws Exception {
		// Set look and feel
		SwingUtilities.invokeAndWait(new Runnable() {
			@Override
			public void run() {

				try {
					UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
				} catch (Exception e) {

				}
			}
		});

		LoginDialog login = new LoginDialog();
		if (login.showDialog() == 0) new StartMcNova(login);

		// new StartMcNova();

		// SessionFactory s = HibernateSession.getInstance();
	}
}
